package com.coship.vas.dapg.action;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import com.opensymphony.xwork2.ActionSupport;

/**
 * 
 * @作者 905613 陈开源 深圳市同洲电子股份有限公司(增值运营产品线)
 *
 */
public class BaseAction extends ActionSupport implements ServletRequestAware, ServletResponseAware {

    private static final long serialVersionUID = 1L;
    
    /**
     * request对象.
     */
    protected HttpServletRequest request;
    
    /**
     * response对象.
     */
    protected HttpServletResponse response;

    /**
     * 
     * Description : 输出内容
     * 
     * @param value
     * 
     */
    public void write(String value) {
        try {
            response.setContentType("text/html;charset=UTF-8");
            response.getWriter().write(value);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }

    public void setServletResponse(HttpServletResponse response) {
        this.response = response;

    }
}
